-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Two-level metadata: Model and appearance #910
base: master
Are you sure you want to change the base?
Conversation
Please rebase this to |
I've deployed this branch on https://test.dfg-viewer.de for testing. Examples can be found here. |
…tructure accordingly
The Metadata object can now hold entry nodes with a new array containing all subentries. These are fetched from the subentries table.
* Updated the domain model and repositories to comply with the new DB structure. * Cleaned up all references to the old table name 'tx_dlf_metadata_subentries'. * Make 'tx_dlf_metadatasubentries' table accessible for some functions in Hooks/Helper class. * Extbase class mappings have to be hold as TypoScript _and_ PHP config as long as TYPO3 9 support is not dropped. In addition, create empty repository class to comply with Extbase conventions.
Required for TYPO3 9.5 support.
Also provided IsArrayViewHelper and respect sub-arrays when building $metaCObjData.
Add a TypoScript Wrap field for subentries in database and TCA.
When XPath functions like concat() are used, evaluate() returns a string instead of a DOMNodeList.
7bf05a6
to
d93ecd3
Compare
I've updated https://test.dfg-viewer.de to the current 1e87169, but this leads to errors: example Unfortunately there are no messages in the admin log pointing to the cause. |
I have enabled the detailed error output on the system. It seems that there are problems with the assets. Clearing the cache doesn't help. |
OK, the problem was the recent renaming of |
Classes/Common/Indexer.php
Outdated
@@ -367,6 +367,7 @@ protected static function processLogical(Document $document, array $logicalUnit) | |||
} | |||
$autocomplete = []; | |||
foreach ($metadata as $index_name => $data) { | |||
// TODO: Include also subentries if available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these TODOs still relevant? The two-level metadata feature should be implemented completely. So either these TODOs are done (and should be removed) or should be done.
Classes/Common/Indexer.php
Outdated
@@ -464,6 +465,7 @@ protected static function processPhysical(Document $document, $page, array $phys | |||
$solrDoc->setField('fulltext', $fullText); | |||
if (is_array($doc->metadataArray[$doc->toplevelId])) { | |||
// Add faceting information to physical sub-elements if applicable. | |||
// TODO: Include also subentries if available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these TODOs still relevant? The two-level metadata feature should be implemented completely. So either these TODOs are done (and should be removed) or should be done.
Classes/Common/Indexer.php
Outdated
//if ($index_name == 'author') { | ||
//$data = self::removeAppendsFromAuthor($data); | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove inactive code.
Classes/Common/MetsDocument.php
Outdated
@@ -559,6 +560,7 @@ class_exists($class) | |||
$queryBuilder->expr()->eq('tx_dlf_metadata.pid', intval($cPid)), | |||
$queryBuilder->expr()->eq('tx_dlf_metadata.l18n_parent', 0), | |||
$queryBuilder->expr()->eq('tx_dlf_metadataformat_joins.pid', intval($cPid)), | |||
//$queryBuilder->expr()->eq('tx_dlf_metadataformat_joins.subentries', 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove inactive code.
Classes/Common/MetsDocument.php
Outdated
// $queryBuilder->expr()->eq('tx_dlf_metadata.l18n_parent', 0), | ||
// $queryBuilder->expr()->eq('tx_dlf_metadataformat_joins.pid', intval($cPid)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove inactive code.
Classes/Common/MetsDocument.php
Outdated
@@ -624,24 +675,23 @@ class_exists($class) | |||
) { | |||
if ( | |||
$resArray['format'] > 0 | |||
&& !empty($resArray['xpath_sorting']) | |||
&& !empty($resArray['xpath_sorting']) // TODO: will fail, for subentries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is bad and should be fixed. ;o)
// TODO: Sebastian fragen | ||
// TODO: Include also subentries if available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these TODOs still relevant? The two-level metadata feature should be implemented completely. So either these TODOs are done (and should be removed) or should be done.
? implode($this->settings['separator'], $value) | ||
: $value; | ||
|
||
// TODO: This might not be necessary for subentries or needs to be typecasted correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these TODOs still relevant? The two-level metadata feature should be implemented completely. So either these TODOs are done (and should be removed) or should be done.
class MetadataSubentryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository | ||
{ | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add linebreak at end of file.
@@ -80,6 +80,7 @@ public function processDatamap_postProcessFieldArray($status, $table, $id, &$fie | |||
} | |||
break; | |||
// Field post-processing for table "tx_dlf_metadata". | |||
// TODO: Include also subentries if available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these TODOs still relevant? The two-level metadata feature should be implemented completely. So either these TODOs are done (and should be removed) or should be done.
# Conflicts: # Classes/Common/Indexer.php # Classes/Common/MetsDocument.php # Classes/Domain/Model/MetadataFormat.php # Configuration/TCA/tx_dlf_metadataformat.php # Resources/Private/Partials/Metadata/Entries.html # ext_typoscript_setup.txt
Extended version of pull request #835